package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.HsHouseMapper;
import com.ruoyi.business.domain.HsHouse;
import com.ruoyi.business.service.IHsHouseService;

/**
 * 房屋Service业务层处理
 * 
 * @author asher
 * @date 2021-11-08
 */
@Service
public class HsHouseServiceImpl implements IHsHouseService 
{
    @Autowired
    private HsHouseMapper hsHouseMapper;

    /**
     * 查询房屋
     * 
     * @param houseId 房屋主键
     * @return 房屋
     */
    @Override
    public HsHouse selectHsHouseByHouseId(Long houseId)
    {
        return hsHouseMapper.selectHsHouseByHouseId(houseId);
    }

    /**
     * 查询房屋列表
     * 
     * @param hsHouse 房屋
     * @return 房屋
     */
    @Override
    public List<HsHouse> selectHsHouseList(HsHouse hsHouse)
    {
        return hsHouseMapper.selectHsHouseList(hsHouse);
    }

    /**
     * 新增房屋
     * 
     * @param hsHouse 房屋
     * @return 结果
     */
    @Override
    public int insertHsHouse(HsHouse hsHouse)
    {
        hsHouse.setCreateTime(DateUtils.getNowDate());
        return hsHouseMapper.insertHsHouse(hsHouse);
    }

    /**
     * 修改房屋
     * 
     * @param hsHouse 房屋
     * @return 结果
     */
    @Override
    public int updateHsHouse(HsHouse hsHouse)
    {
        hsHouse.setUpdateTime(DateUtils.getNowDate());
        return hsHouseMapper.updateHsHouse(hsHouse);
    }

    /**
     * 批量删除房屋
     * 
     * @param houseIds 需要删除的房屋主键
     * @return 结果
     */
    @Override
    public int deleteHsHouseByHouseIds(Long[] houseIds)
    {
        return hsHouseMapper.deleteHsHouseByHouseIds(houseIds);
    }

    /**
     * 删除房屋信息
     * 
     * @param houseId 房屋主键
     * @return 结果
     */
    @Override
    public int deleteHsHouseByHouseId(Long houseId)
    {
        return hsHouseMapper.deleteHsHouseByHouseId(houseId);
    }
}
